package com.qf.map;

import com.qf.collection.Dog;

import java.util.HashMap;

/**
 * HashMap的应用场景
 * 把map对象当作一个属性可以动态变化的对象
 */
public class Demo02 {
    public static void main(String[] args) {

        Dog dog1 = new Dog("柯基",1);

        // {"name":"柯基","age",1}

        HashMap<String, Object> dog2 = new HashMap<>();
        dog2.put("name","哈士奇");
        dog2.put("age",2);
        dog2.put("color","blue");
        System.out.println(dog1);
        System.out.println(dog2);

    }
}
